<!DOCTYPE HTML>
<html>
    <head>
        <title>Example</title>
        <meta name="author" content="Adam Freeman"/>
        <meta name="description" content="A simple example"/>
        <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
        <style>
            table {
                border: solid thin black;
                border-collapse: collapse;
                margin: 10px;
                float: left;
            }
            td { padding: 4px 5px; }
            p { clear:left; }
        </style>
    </head>
    <body>
        <table border="1">
            <thead><tr><th>Fruit</th><th>Color</th></tr></thead>
            <tbody>
                <tr><td>Banana</td><td>Yellow</td></tr>
                <tr id="apple"><td>Apple</td><td>Red/Green</td></tr>
            </tbody>
        </table>

        <table border="1">
            <thead><tr><th>Fruit</th><th>Color</th></tr></thead>
            <tbody id="fruitsBody">
                <tr><td>Plum</td><td>Purple</td></tr>
            </tbody>
        </table>

        <p>
            <button id="move">Move Row</button>
        </p>
        <script>
            document.getElementById("move").onclick = function() {
                
                var elem = document.getElementById("apple");
                // 移动元素 其实就是添加到另一个的子元素 挠头
                document.getElementById("fruitsBody").appendChild(elem);
            };
        </script>
    </body>
</html>
